﻿/*===============================================================
	TASK 7:                              {Conditional Statements}
	Write a program that finds the greatest of given 5 variables. 
===============================================================*/

using System;

class GreatestOfFiveVariables
{
    static void Main()
    {
        double firstNum, secondNum, thirdNum,fourthNum,fifthNum;

        Console.Write("first number= ");
        firstNum = double.Parse(Console.ReadLine());
        Console.Write("second number=");
        secondNum = double.Parse(Console.ReadLine());
        Console.Write("third number= ");
        thirdNum = double.Parse(Console.ReadLine());
        Console.Write("fourth number=");
        fourthNum = double.Parse(Console.ReadLine());
        Console.Write("fifth number= ");
        fifthNum = double.Parse(Console.ReadLine());

        float greatest;
        greatest = (float)firstNum;
        if (greatest<secondNum)
        {
            greatest = (float)secondNum;
        }
        if (greatest < thirdNum)
        {
            greatest = (float)thirdNum;
        }
        if (greatest < fourthNum)
        {
            greatest = (float)fourthNum;
        }
        if (greatest < fifthNum)
        {
            greatest = (float)fifthNum;
        }
        Console.WriteLine("\ngreatest number is:{0}",greatest);
        
    }
}

